package weeny.pre.expression;

import prefuse.data.Schema;
import prefuse.data.Tuple;
import prefuse.data.expression.FunctionExpression;

/**
 * just copied from prefuse source code, since the class there only has package
 * accessability
 * 
 * @see FunctionExpression
 **/
public abstract class IntFunction extends FunctionExpression {
    protected IntFunction(int parameterCount) {
        super(parameterCount);
    }
    public Class getType(Schema s) {
        return int.class;
    }
    public Object get(Tuple t) {
        return new Integer(getInt(t));
    }
    public long getLong(Tuple t) {
        return (long)getInt(t);
    }
    public float getFloat(Tuple t) {
        return (float)getFloat(t);
    }
    public double getDouble(Tuple t) {
        return (double)getInt(t);
    }
}